<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>web-vitals</title>
</head>
<body>
    <script type="module">
        import {onCLS, onINP, onLCP} from 'https://unpkg.com/web-vitals@4?module';
      
        onCLS(console.log);
        onINP(console.log);
        onLCP(console.log);
      </script>

      <script>
        window.addEventListener('pageShow',function(event){
            requestAnimationFrame(()=>{
                ['load'].forEach(type=>{
                   const testTime =  performance.now() - event.timeStamp;
                   console.log(`${type}时间:${testTime}`)
                })
            },true)
        })
      </script>
</body>
</html>